package router

import (
	"gitee.com/tang_q/gin-vue3-admin-api/api"
	"github.com/gin-gonic/gin"
)

func BrandRoute() {
	RegisterRoute(func(rgPublic *gin.RouterGroup, rgAuth *gin.RouterGroup) {
		brand := api.NewBrandApi()
		//rgPublicRole := rgPublic.Group("role").Use(func() gin.HandlerFunc {
		//	return func(c *gin.Context) {
		//		// 这里写公共接口的中间件
		//	}
		//}())
		//{
		//	 // 公开接口
		//}
		rgAuthBrand := rgAuth.Group("brand")
		{
			rgAuthBrand.POST("/list", brand.GetBrandList)
			rgAuthBrand.GET("/region", brand.GetRegions)
			rgAuthBrand.GET("/category", brand.GetCategories)
			rgAuthBrand.POST("/createRegOrCat", brand.CreateRegOrCat)
			rgAuthBrand.POST("/createBrand", brand.CreateBrand)
			rgAuthBrand.POST("/updateBrand", brand.UpdateBrand)
			rgAuthBrand.DELETE("/deleteBrand/:id", brand.DeleteBrand)
			rgAuthBrand.DELETE("/batchDeleteBrand", brand.DeleteBrandBatch)
		}
	})
}
